load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "keydecoder",
    srcs = ["keydecoder.go"],
    importpath = "github.com/pingcap/tidb/pkg/util/keydecoder",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/infoschema",
        "//pkg/kv",
        "//pkg/meta/model",
        "//pkg/tablecodec",
        "//pkg/util/logutil",
        "@com_github_pingcap_errors//:errors",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "keydecoder_test",
    timeout = "short",
    srcs = [
        "keydecoder_test.go",
        "main_test.go",
    ],
    embed = [":keydecoder"],
    flaky = True,
    deps = [
        "//pkg/infoschema",
        "//pkg/meta/model",
        "//pkg/parser/ast",
        "//pkg/planner/core",
        "//pkg/sessionctx/stmtctx",
        "//pkg/table",
        "//pkg/table/tables",
        "//pkg/testkit/testsetup",
        "//pkg/testkit/testutil",
        "//pkg/types",
        "//pkg/util/codec",
        "@com_github_stretchr_testify//assert",
        "@io_opencensus_go//stats/view",
        "@org_uber_go_goleak//:goleak",
    ],
)
